#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "alarmmanager.h"
#include "systemtray.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class AlarmEventTableModel;
class MainWindow : public QMainWindow {
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

protected:
    void changeEvent(QEvent *event);
    void closeEvent(QCloseEvent *event);
private slots:
    void onAddAlarm();
    void onRemoveAlarm();
    void handleAlarm(const AlarmEvent &event);

private slots:
    void onTrayIconActivated(QSystemTrayIcon::ActivationReason reason);
    void showNormalWindow();

private:
    AlarmManager *alarmManager;
    SystemTray *systemTray;
    QSystemTrayIcon *trayIcon;
       bool isMinimizedToTray = false;
       AlarmEventTableModel *model;
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H
